

import eu.jpereira.trainings.designpatterns.structural.facade.model.DispatchReceipt;
import eu.jpereira.trainings.designpatterns.structural.facade.model.Order;
import eu.jpereira.trainings.designpatterns.structural.facade.service.BookDBService;
import eu.jpereira.trainings.designpatterns.structural.facade.service.CustomerDBService;
import eu.jpereira.trainings.designpatterns.structural.facade.service.CustomerNotificationService;
import eu.jpereira.trainings.designpatterns.structural.facade.service.OrderingService;
import eu.jpereira.trainings.designpatterns.structural.facade.service.WharehouseService;

public class DefaultBooktoreFacade implements BookstoreFacade{
	public OrderingService orderingService;
	public CustomerDBService customerService;
	public BookDBService bookDBservice;
	public WharehouseService wharehouseService;
	public CustomerNotificationService cns;
	
	@Override
	public void placeOrder(String customerId, String isbn) {
		Order order = orderingService.createOrder(customerService.findCustomerById(customerId), bookDBservice.findBookByISBN(isbn));

		DispatchReceipt dispatchReceipt1 = wharehouseService.dispatch(order);
		
		cns.notifyClient(order);
		cns.notifyClient(dispatchReceipt1);
	}

}
